home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / XCMD libraries 960603 / Read.me < prev    next >
Text File  |  1996-06-04  |  5KB  |  102 lines

  1. These are some additional notes for the xcmd Class presented here.
  2.  
  3. F    7386  7:03 PM 11/15/95 CWIE TEXT 0x0100 xcmdStrings.cp    -- xcmdString class
  4. F    4017  7:03 PM 11/15/95 CWIE TEXT 0x0100 xcmdStrings.h
  5. F    6606  3:56 PM 11/15/95 CWIE TEXT 0x0100 xcmdBase.cp    -- xcmdBase class
  6. F    3002 10:21 PM 11/13/95 CWIE TEXT 0x0100 xcmdBase.h
  7. F   10054  8:27 AM 11/16/95 CWIE TEXT 0x0100 xcmdWind.cp    -- xcmdWind class
  8. F    5185  8:27 AM 11/16/95 CWIE TEXT 0x0100 xcmdWind.h
  9.  
  10. o xcmdString
  11.  
  12. There are three base classes.  The first is essential to both and provides 
  13. the glue for making the other two work smoothly: xcmdString.  This class 
  14. handles all the troublesome conversions between pascal like and c like 
  15. strings.  Strings passed in handles can be up to 32k in size.  Standard 
  16. pascal strings can only accomodate 255.  Many of the xcmd routines, 
  17. nevertheless, only take pascal string arguments.  xcmdString provides a 
  18. seamless way to convert and use these containers without having to pay close 
  19. attention to the details.  If you are familiar with the LString class in 
  20. power plant you will notice some superficial similarities.  xcmdString was 
  21. devised many years before LString and is not as complete.  It does, however, 
  22. take full advantage of the string conversion callbacks in order to a) save 
  23. code space and b) to remain consistant with the hc way of converting values.  
  24. It is designed and intended for use within the xcmd context and serves that 
  25. function well.
  26.  
  27. o xcmdBase
  28.  
  29. The next class is the xcmdBase class.  If you are only seeking to create an 
  30. xcmd that does not need or use an xcmdWindow then you need only use this 
  31. class.  There is only one instance of the xcmdBase class permitted per xcmd 
  32. call.  Usually you set up an A4 frame, call the main cpp routine, 
  33. instantiate a member of the xcmdBase class with the paramPtr as a single 
  34. argument and go to it.  The constructor copies the paramPtr to a common 
  35. global location so that all the call backs work without having to worry 
  36. about this detail.  Parameters can be checked and states configured using 
  37. the xcmdString class.
  38.  
  39. A more likely scenario is to create a subclass of xcmdBase and include any
  40. special methods and private storage for your methods.
  41.  
  42. o xcmdWind
  43.  
  44. The last class is a descendant of xcmdBase and handles xcmds with xwindows.  
  45. It takes care of most of the messy and mundane window handling routines 
  46. allowing you to deal with the important details.  The best way to implement 
  47. your xWindow xcmd is to create a custom class and override only those 
  48. features you want to handle.
  49.  
  50. xcmdWind like xcmdBase, should probably be pure virtual.  But I wanted to be 
  51. able to provide a simple default behavior without having to do a thing.  In 
  52. other words, to create a simple, mindless, do nothing xcmd all you need do 
  53. is throw these classes into a project along with the example startup, 
  54. compile and go.  Things will happen.  Hopefully, not bad things.  There are 
  55. some small caveats as with all stand alone code resources:
  56.  
  57. 1) Include the New.cp provided with CW and be sure to set the 
  58.     #define NEWMODE NEWMODE_SIMPLE switch.  This will turn caching off
  59.     and allow the use of direct NewPtr and DisposPtr calls.
  60. 2) Be sure to set the preferences for an XCMD or XFCN code resource.
  61.     and DONT try to create a C++ entry point.  Create a simple C main which 
  62.     sets up the A4 environment and calls your C++ routine.  If you fail to do 
  63.     this when you destructor gets called after the A4 is restored, all hell 
  64.     breaks loose.  This is a good practice for any code resource. 
  65.     See example provided.
  66.  
  67. To this project you need to add...
  68. MacOS.lib, HyperXLib.o, CPlusPlusA4.lib, an ANSI A4 lib if needed., and your
  69. modified New.cp with the appropriate declarations described above.
  70.  
  71. As always....
  72. Please, please, please, in the unlikely event you should use this stuff
  73. for some commercial application I would appreciate you contacting me.  If
  74. its for your own use, use away. Send email: knowsoft@ios.com
  75.  
  76. As always: this file is presented as is with no warrantees expressed or implied.
  77. Swim at your own risk, etc. etc.
  78.  
  79. 10/29/95    The library is posted to MW object code library.  Originally 
  80.     written for Symantec and ported to CW4.
  81.  
  82. 11/11/95    After some months I tried using this with CW7.  The
  83.     stricter type checking with the new compiler revealed some 
  84.     minor potential bugs fixed here.  I've made some simple 
  85.     modifications to the xcmdBase file as well as xcmdString 
  86.     object.  While the interface is the same (don't you love 
  87.     data hidding!) the structure of xcmdString is very 
  88.     different.  Instead of converting strings I simply pass 
  89.     different offsets depending on whether a pascal or c string 
  90.     is needed.  My understanding of c++ has also matured so I 
  91.     have made some minor modifications to xcmdBase in order to 
  92.     take advantage of the better xcmdStrings implementation.
  93.  
  94.  6/3/96        I just received CW9 and discovered some significant changes 
  95.      in the E.T.O. version of the hypercard library.  The XCMD libraries
  96.      here were modified to reflect those changes.
  97. ------------------------------------------------------------------------
  98. Knowledge Software Consulting                        knowsoft@ios.com
  99. 1204 Hall Ave                                        tel: (914) 428-6654
  100. White Plains, NY 10604                               fax: (914) 993-9210
  101.  
  102.